#ifndef _Task
#define _Task

#include "ParamManager.h"
#include "BlockManager.h"


enum State {
	PENDING,
	ACTIVE,
	COMPLETE
};

class Task {

public:
	// for link list purposes	
	Task *prev, *next;

//	BlockManager bm;

	char *id;
	State state;
	ParamManager pm;	// task details
	int threads;
	time_t timestamp;

	HANDLE drone_handle;
	unsigned drone_id;

	// reported by drones for the purpose of status_get
	ParamManager status;

	// if the task has finished loading its details
	bool isLoaded;
	int num_details;

	// if the task has been deleted, we need to cleanup and delete
	bool isShutdown;

	// if a drone exists for this task
	bool isDrone;
	bool isDroneAssigned;	// drone launched, but has it been assigned to task

	// Constructor
	Task();
	// Deconstructor
	~Task();
};

#endif /* _TASK */